﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PreAndRe.aspx.cs" Inherits="QuerySelectionLabelingTool.PreAndRe" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="labelTaskName" runat="server" Font-Size="20"></asp:Label>
    <br />
    <asp:Label ID="labelNewsCompCount" runat="server"></asp:Label>
    <br />
    <asp:Chart ID="Chart1" runat="server" 
        DataSourceID="ObjectDataSourcePreAndRe" Width="898px" Height="436px" 
        ondatabinding="Chart1_DataBinding">
        <series>
            <asp:Series LabelToolTip="precision" Name="Precision" XValueMember="name" 
                YValueMembers="Precision" ChartArea="ChartArea1" ChartType="Bar" 
                Legend="Legend1">
            </asp:Series>
            <asp:Series ChartArea="ChartArea1" LabelToolTip="recall" Name="Recall" XValueMember="name" 
                YValueMembers="Recall" ChartType="Bar" Legend="Legend1">
            </asp:Series>
            <asp:Series ChartArea="ChartArea1" ChartType="Bar" Legend="Legend1" 
                Name="Coverage" XValueMember="name" YValueMembers="Coverage">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1" AlignmentOrientation="Horizontal">
                <AxisY Maximum="1">
                    <LabelStyle Format="0%" />
                </AxisY>
            </asp:ChartArea>
        </chartareas>
        <Legends>
            <asp:Legend Name="Legend1">
            </asp:Legend>
        </Legends>
    </asp:Chart>
    <asp:ObjectDataSource ID="ObjectDataSourcePreAndRe" runat="server" 
        SelectMethod="GetPreAndReDataSet" 
        TypeName="QuerySelectionLabelingTool.PreAndRe"></asp:ObjectDataSource>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSourcePreAndRe" Width="795px" Height="141px" 
        AllowPaging="True" ondatabound="GridView1_DataBound">
        <Columns>
            <asp:BoundField DataField="name" HeaderText="Experiment Name" 
                SortExpression="name" >
            <ItemStyle Width="125px" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Precision" HeaderText="Precision" 
                SortExpression="Precision" ReadOnly="True" DataFormatString="{0:P}" >
            <ItemStyle Width="125px" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Recall" HeaderText="Recall" 
                SortExpression="Recall" ReadOnly="True" DataFormatString="{0:P}" >
            <ItemStyle Width="125px" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Coverage" DataFormatString="{0:P}" 
                HeaderText="Coverage" ReadOnly="True">
            <ItemStyle HorizontalAlign="Center" Width="125px" />
            </asp:BoundField>
        </Columns>
    </asp:GridView>
<br />
    <br />
    Progress<br />
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
    DataSourceID="SqlDataSourceAllUserTaskProcess" Width="796px" 
        AllowPaging="True" ondatabound="GridView2_DataBound">
    <Columns>
        <asp:BoundField DataField="name" HeaderText="Judger" 
            SortExpression="name" >
            <ItemStyle Width="166px" HorizontalAlign="Center" />
            </asp:BoundField>
        <asp:BoundField DataField="Incomplete" 
            HeaderText="Incomplete" ReadOnly="True" 
            SortExpression="Incomplete" >
            <ItemStyle Width="166px" HorizontalAlign="Center" />
            </asp:BoundField>
        <asp:BoundField DataField="Total" HeaderText="Total" 
            ReadOnly="True" SortExpression="Total" >
            <ItemStyle Width="166px" HorizontalAlign="Center" />
            </asp:BoundField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSourceAllUserTaskProcess" runat="server" 
    ConnectionString="<%$ ConnectionStrings:QuerySelectionLabelingToolConnectionString %>" 
    
        
        
        SelectCommand="SELECT tb_user.ID, tb_user.name, tb_IncomNewsCount.Incomplete, tb_allNewsCount.Total FROM tb_user INNER JOIN (SELECT userID, COUNT(*) AS Total FROM (SELECT userID, newsID FROM tb_experiments WHERE (taskID = @taskID) GROUP BY userID, newsID) AS tb_news1 GROUP BY userID) AS tb_allNewsCount ON tb_allNewsCount.userID = tb_user.ID LEFT OUTER JOIN (SELECT userID, COUNT(*) AS Incomplete FROM (SELECT userID, newsID FROM tb_experiments AS tb_experiments_1 WHERE (taskID = @taskID) AND (isComplete = 0) GROUP BY userID, newsID) AS tb_news2 GROUP BY userID) AS tb_IncomNewsCount ON tb_allNewsCount.userID = tb_IncomNewsCount.userID">
    <SelectParameters>
        <asp:QueryStringParameter Name="taskID" QueryStringField="taskID" />
    </SelectParameters>
</asp:SqlDataSource>
</asp:Content>
